package org.example.service;

import org.example.entity.UserEntity;
import org.example.exception.UserException;

/**
 * @author HanJiafeng
 */
public interface IUserService {
    /**
     * 检查用户名是否存在
     *
     * @param username username
     * @return 存在与否
     * @throws UserException 异常
     */
    Boolean checkUsername(String username) throws UserException;

    /**
     * 注册
     *
     * @param userEntity user
     * @throws UserException 异常
     */
    int regist(UserEntity userEntity) throws UserException;

    /**
     * 登录
     *
     * @param username username
     * @param password password
     * @return 登陆后的用户
     * @throws UserException UserException
     */
    UserEntity login(String username, String password) throws UserException;
}
